package com.bjsxt.backend.item.feign;

import com.bjsxt.pojo.*;
import com.bjsxt.utils.PageResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @author zhanlz
 * @FeignClient(value="common-item") 绑定服务名
 */
@FeignClient(value = "common-item")
public interface CommonItemFeignClient {

    //---------------------/service/item/selectTbItemAllByPage
    @GetMapping("/service/item/selectTbItemAllByPage")
    PageResult selectTbItemAllByPage(@RequestParam("page") Integer page, @RequestParam("rows") Integer rows);
    //---------------------/service/item/selectItemCategoryByParentId
    @PostMapping("/service/itemCategory/selectItemCategoryByParentId")
    List<TbItemCat> selectItemCategoryByParentId(@RequestParam("id") Long id);
    //--------------------/service/itemParam/selectItemParamByItemCatId
    @PostMapping("/service/itemParam/selectItemParamByItemCatId")
    TbItemParam selectItemParamByItemCatId(@RequestParam("itemCatId") Long itemCatId);
    //--------------------/service/item/insertTbItem添加
    @PostMapping("/service/item/insertTbItem")
    Integer insertTbItem(@RequestBody TbItem tbItem);
    //--------------------/service/itemDesc/insertItemDesc
    @PostMapping("/service/itemDesc/insertItemDesc")
    Integer insertItemDesc(@RequestBody TbItemDesc tbItemDesc);
    //--------------------/service/itemParamItem/insertTbItemParamItem
    @PostMapping("/service/itemParamItem/insertTbItemParamItem")
    Integer insertTbItemParamItem(@RequestBody TbItemParamItem tbItemParamItem);
    //--------------------/service/item/deleteItemById
    @PostMapping("/service/item/deleteItemById")
    Integer deleteItemById(@RequestBody TbItem tbItem);
    //--------------------/service/item/preUpdateItem
    @PostMapping("/service/item/preUpdateItem")
    Map<String,Object> preUpdateItem(@RequestParam("itemId") Long itemId);

    @PostMapping("/service/item/updateTbitem")
    Integer updateTbitem(@RequestBody TbItem tbItem);

    @PostMapping("/service/itemDesc/updateItemDesc")
    Integer updateItemDesc(@RequestBody  TbItemDesc tbItemDesc);

    @PostMapping("/service/itemParamItem/updateItemParamItem")
    Integer updateItemParamItem(@RequestBody TbItemParamItem tbItemParamItem);
}
